﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Mvc;
using System.Web;
using Project.Engine.Utilities;
using System.Web.SessionState;
using Project.Module.DAO.CMSBL;
namespace Project.Module.Controller
{
    class CMSManagerSupplier
    {
    }

    public partial class HomeController {
        public JsonResult AddNewSupplier(string name, string desc, string address, string user) {
            (new SupplierBL()).AddNewSupplier(name, desc, address, user);
            return Json(new { result = 1}, JsonRequestBehavior.AllowGet);
        }

        public ActionResult DeleteSupplier(int supplierID) {
            (new SupplierBL()).DeleteSupplier(supplierID);
            return Redirect("/admin/quan-ly-nha-cung-cap");
        }

        public JsonResult EditSupplier(int id, string name, string desc, string address, string user)
        {
            (new SupplierBL()).EditSupplier(id, name, desc, address, user);
            return Json(new { result = 1 }, JsonRequestBehavior.AllowGet);
        }

    }
}
